/*
 * @Author: MrDotYan 2564217790@qq.com
 * @Date: 2024-09-14 10:40:09
 * @LastEditors: MrDotYan 2564217790@qq.com
 * @LastEditTime: 2024-09-27 11:02:36
 * @FilePath: /webServerAdmin/src/api/modules/email.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import http from "@/api";
import { PORT1 } from "@/api/config/servicePort";
import { EmailSchema, SendCaptcha } from "@/schema";
import { Id, ReqPage } from "../interface";

export function sendCaptchaEmail(data: SendCaptcha) {
  return http.post<{ key: string }>(`${PORT1}/email/sendCaptcha`, data);
}

export function senEmail(data: EmailSchema) {
  return http.post<EmailSchema>(`${PORT1}/email/save`, data);
}

export function fetchEmailList(data: ReqPage) {
  return http.post<Array<EmailSchema>>(`${PORT1}/email/list`, data);
}

export function fetchEmailInfo(params: Id) {
  return http.get<EmailSchema>(`${PORT1}/email/info`, params);
}

export function removeEmail(params: Id) {
  return http.delete<EmailSchema>(`${PORT1}/email/remove`, params);
}
